<template>
	<view class="allwrap">
		<view style="position: fixed;width: 686rpx;z-index: 10;">
		<u-search placeholder="搜索手机号/邮箱/账号添加" v-model="keyword" :show-action="false" :height="68"></u-search>
		</view>
		<view style="height:90rpx;"></view>
		<view class="flexal" style="margin-top: 32rpx;" v-for="(item,index) in list" :key="index">
			<image :src="item.avatar" class="img"></image>
			<view class="text flexal">
			<text >{{item.name}}</text>
			<view class="tag flexcenter" v-if="index==0">群主</view>
			</view>
			<!-- <image src="/static/right.png" style=""></image> -->
			<view class="flexcen button-frame" v-if="type == 0" :class="item.checked ? '': 'button-frame-active'" >{{ item.checked ?  '已验证':'通过验证' }}</view>
		</view>
		
		<!-- 添加/移除 -->
		<u-mask :show="show" @click="show = false">
				<view class="warp">
					<view>
					<view class="frame-video flexcumal">
						<view class="text flexcenter" @click="submit(0)">添加群成员</view>
						<u-line color="#707070" length="622rpx" style="opacity: 0.17;" />
						<view class="text flexcenter" style="color: #D54941;" @click="submit(1)">移除群成员</view>
					</view>
					<view class="frame-video-cancel flexcenter">
						取消
					</view>
					</view>
			</view>
		</u-mask>
		
	</view>
</template>

<script>
	export default {
		name:"people",
		props:{
			// 联系人列表
			list: {
				type: Array,
				default: []
			},
			// 0:进群验证 1:群成员  3:创建群组
			type:{
				type:Number,
				default:0
			}
		},
		data() {
			return {
				keyword:'',
				show:false,
				openPop:false,
			};
		},
		watch:{
			// list: {
			// 	handler(value) { //这是vue的规定写法，当你watch的值发生变化的时候，就会触发这个handler，这是vue内部帮你做的事情
			// 	console.log('成员数据变化',value)
			// 	},
			// 	deep: true, // 可以深度检测到 obj 对象的属性值的变化
			// 	immediate: true //刷新加载  立马触发一次handler
			// },
		},
		methods:{
			// 打开用户操作
			open(){
				if(this.type == 1){
					this.show = !this.show
				}
			},
			submit(type){
				this.$emit('peopleSubmit',type)
			}
		}
	}
</script>

<style lang="less">
	
	.img{
		width: 100rpx;
		height: 100rpx;
		// background: #888888;
		border-radius: 50%;
	}

	.text{
		margin-left: 24rpx;
		flex: 1;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	.button-frame{
		width: 135rpx;
		height: 45rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		border: 2rpx solid #A2A6B1;
		font-weight: normal;
		font-size: 26rpx;
		color: #858A99;
	}
	.button-frame-active{
		color: #0052D9;
		border: 2rpx solid #0052D9;
	}
	.tag{
		margin-left: 24rpx;
		width: 80rpx;
		height: 38rpx;
		background: #D9E1FF;
		border-radius: 11rpx 11rpx 11rpx 11rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #0052D9;
	}
	
	.warp {
		display: flex;
		align-items: flex-end;
		justify-content: center;
		height: 100%;
		.frame-video{
			  width: 686rpx;
			  height: 188rpx;
			  background: #FFFFFF;
			  border-radius: 24rpx 24rpx 24rpx 24rpx;
		}
		.text{
			width: 100%;
			height: 94rpx;
			font-weight: 400;
			font-size: 30rpx;
			color: #333333;
		}
		.frame-video-cancel{
			margin-top: 22rpx;
			margin-bottom: 60rpx;
			width: 686rpx;
			height: 94rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
		}
	}
</style>